package com.appkubes.mall.admin.application.goods.sku.dao;

import com.appkubes.mall.admin.application.goods.sku.entity.model.AttributeModel;
import com.appkubes.mall.core.pojo.MallSpecificAttributeMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface SpecificAttributeDao extends MallSpecificAttributeMapper {

    @Select("SELECT *, 2 AS level, true as checked, specific_attribute_key as `key` FROM mall_specific_attribute WHERE app_key=#{appKey} AND specific_type_key=#{specificTypeKey} ORDER BY specific_attribute_index desc")
    List<AttributeModel> getList(@Param("appKey")String appKey, @Param("specificTypeKey")String specificTypeKey);
}
